package com.engine4cloud.tdf.common.security.service;

import lombok.Getter;
import org.springframework.security.core.GrantedAuthority;

import java.util.Collection;
import java.util.Set;

/**
 * @author: 邢卫
 * 平台终端用户
 * @date: 2024年03月04日 11:06
 */
@Getter
public class TdfPFUser extends TdfUser {

    /**
     * 平台用户管理的部门
     */
    private Set<Long> deptIds;

    /**
     * Construct the <code>User</code> with the details required by
     * {@link DaoAuthenticationProvider}.
     *
     * @param id                    用户ID
     * @param username
     * @param deptId                部门ID
     * @param phone
     * @param avatar
     * @param nickname              昵称
     * @param name                  姓名
     * @param email                 邮箱 the username presented to the
     *                              <code>DaoAuthenticationProvider</code>
     * @param tenantId              租户ID
     * @param password              the password that should be presented to the
     *                              <code>DaoAuthenticationProvider</code>
     * @param enabled               set to <code>true</code> if the user is enabled
     * @param accountNonExpired     set to <code>true</code> if the account has not expired
     * @param userType
     * @param credentialsNonExpired set to <code>true</code> if the credentials have not
     *                              expired
     * @param accountNonLocked      set to <code>true</code> if the account is not locked
     * @param authorities           the authorities that should be granted to the caller if they
     *                              presented the correct username and password and the user is enabled. Not null.
     * @throws IllegalArgumentException if a <code>null</code> value was passed either as
     *                                  a parameter or as an element in the <code>GrantedAuthority</code> collection
     */
    public TdfPFUser(Long id, String username, Set<Long> deptIds, String phone, String avatar, String nickname, String name, String email, Long tenantId, String password, boolean enabled, boolean accountNonExpired, String userType, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) {
        super(id, username, null, phone, avatar, nickname, name, email, tenantId, password, enabled, accountNonExpired, userType, credentialsNonExpired, accountNonLocked, authorities);
        this.deptIds = deptIds;
    }


}
